import { Switch, withRouter } from "react-router";
import loadable from "../utils/loadable";
import PermissionRouter from "../utils/PermissionRouter";

const Department = loadable(
  () => import("../containers/DepartmentManage/views/Department")
);

// const EntranceAppovalingTable = loadable(() => import("../containers/EntranceManage/views/EntranceApprovaling/EntranceAppovalingTable"))
const StudentManageTable = loadable(
  () =>
    import(
      "../containers/EntranceManage/views/StudentManage/StudentAccessManage/StudentAccessManageTable"
    )
);
// const RegisterAppovalingTable = loadable(() => import("../containers/EntranceManage/views/EntranceApprovaling/RegisterAppovalingTable"))
const EquipmentManage = loadable(
  () => import("../containers/EquipmentManage/views/Equipment")
);
const EquipmentManipulate = loadable(
  () => import("../containers/EquipmentManipulate/views/EquipmentManipulate")
);
const SchoolManage = loadable(
  () => import("../containers/SchoolManage/views/SchoolManage")
);
const AccessRecord = loadable(
  () => import("../containers/EntranceManage/views/AccessRecord/AccessRecord")
);
const StudentInformationManage = loadable(
  () =>
    import(
      "../containers/EntranceManage/views/StudentManage/StudentInformationManage/StudentInformationManageTable"
    )
);
const PersonManageTable = loadable(
  () => import("../containers/StaffManage/views/PersonManageTable")
);
const AddressManage = loadable(
  () =>
    import(
      "../containers/EntranceManage/views/AddressManage/AddressManageTable"
    )
);
const CampusManage = loadable(
  () =>
    import("../containers/EntranceManage/views/AddressManage/CampusManageTable")
);
const SchoolAnalysis = loadable(
  () => import("../containers/DataAnalysis/SchoolAnalysis/views/SchoolAnalysis")
);
const DormAnalysis = loadable(
  () => import("../containers/DataAnalysis/DormAnalysis/views/DormAnalysis")
);
const StudentCardRecordIn = loadable(
  () => import("../containers/StudentCardRecordIn/views/StudentCardManageTable")
);
// const ChannelStaffManage = loadable(() => import("../containers/ChannelStaffManage/views/ChannelStaffManageTable"))
const AllSchool = loadable(
  () => import("../containers/DataAnalysis/Allschool/AllSchoolDetail")
);
const RuleManage = loadable(
  () => import("../containers/RuleManage/view/RuleManage")
);
const BulkImport = loadable(
  () => import("../containers/Bulkimport/view/Index")
);
const Record = loadable(() => import("../containers/RecordManage/Record"));
//请假管理
const Leaves = loadable(() => import("@/containers/Leaves/Leaves"));

// 学生证批量换新
const StudentCardEenew = loadable(
  () => import("@/containers/StudentCardEenew/Index")
);
/*学生证解绑*/
const Unbinding = loadable(
  () => import("@/containers/StudentsOperations/index")
);

/*成绩管理*/
const Achievement = loadable(
  () => import("@/containers/interactManage/Achievement/Achievement")
);

/*成绩发布*/
const AchievementIssue = loadable(
  () => import("@/containers/interactManage/AchievementIssue/AchievementIssue")
);

/*作业布置*/
const ReleaseInformation = loadable(
  () =>
    import("@/containers/interactManage/ReleaseInformation/ReleaseInformation")
);

/*信息发布*/
const ReleaseInformationAudit = loadable(
  () => import("@/containers/interactManage/ReleaseInformationAudit/index")
);

/*智能学生证免打扰*/
const Curriculum = loadable(() => import("@/containers/Curriculum/Index"));
const CurriculumStudent = loadable(
  () => import("@/containers/Curriculum/CurriculumStudent")
);
/*视频监控*/
const VideoSurveillance = loadable(
  () => import("@/containers/VideoSurveillance/index")
);

//  疫情防控 --  人员统计
const Personnel = loadable(
  () => import("@/containers/EpidemicSituation/Personnel/Index")
);
//  疫情防控 --  异常人员
const Abnormal = loadable(
  () => import("@/containers/EpidemicSituation/Abnormal/Index")
);
//  疫情防控 --  访客记录
const Visitor = loadable(
  () => import("@/containers/EpidemicSituation/Visitor/Index")
);

//  终端管理 -- 门禁设备管理
const Equipment = loadable(
  () => import("@/containers/Equipment/views/Equipment")
);
//  终端管理 -- 视屏设备管理
const VideoTerminal = loadable(
  () => import("@/containers/Terminal/VideoTerminal/Index")
);
//  终端管理 --  扫码设备管理
const ScanTerminal = loadable(
  () => import("@/containers/Terminal/ScanTerminal/Index")
);

//  系统管理 - 点亮学校
const LightUpSchool = loadable(
  () => import("@/containers/LightUpSchool/Index")
);

// 访客审核记录管理
const VisitorSreview = loadable(
  () =>
    import("@/containers/EntranceManage/views/VisitorSreview/VisitorSreview")
);

const VideoAttendance = loadable(
  () => import("@/containers/DataAnalysis/VideoAttendance/Index")
);

function ContentRoutes() {
  return (
    <Switch>
      {/*/!*{注册审核}*!/*/}
      {/*<PermissionRouter path="/homepage/entranceManage/registerApproval" component={RegisterAppovalingTable}/>*/}
      {/*/!* 门禁审核 *!/*/}
      {/*<PermissionRouter path="/homepage/entranceManage/entranceApproval" component={EntranceAppovalingTable}/>*/}
      {/* 部门管理 */}
      <PermissionRouter
        path="/homepage/systemManage/deptManage"
        component={Department}
      />
      {/* 设备挂靠部门 */}
      <PermissionRouter
        path="/homepage/systemManage/devManage"
        component={EquipmentManage}
      />
      {/* 学生门禁管理 */}
      <PermissionRouter
        path="/homepage/entranceManage/studentaccessManage"
        component={StudentManageTable}
      />
      {/*人员信息管理*/}
      <PermissionRouter
        path="/homepage/entranceManage/studentinformationManage"
        component={StudentInformationManage}
      />
      {/* 地址管理 */}
      <PermissionRouter
        path="/homepage/systemManage/addressmanage"
        component={AddressManage}
      />
      {/* 校区管理 */}
      <PermissionRouter
        path="/homepage/systemManage/campusmanage"
        component={CampusManage}
      />
      {/*校园周报*/}
      <PermissionRouter
        path="/homepage/systemManage/schooldetail"
        component={AllSchool}
      />
      {/* 设备管理 */}
      <PermissionRouter
        path="/homepage/systemManage/equipment"
        component={Equipment}
      />
      {/* 设备操作 */}
      <PermissionRouter
        path="/homepage/systemManage/equipmentManipulate"
        component={EquipmentManipulate}
      />
      {/* 人员管理 */}
      <PermissionRouter
        path="/homepage/systemManage/personManage"
        component={PersonManageTable}
      />
      {/* 学校管理 */}
      <PermissionRouter
        path="/homepage/systemManage/SchoolManage"
        component={SchoolManage}
      />

      {/* 系统管理 - 点亮学校 */}
      <PermissionRouter
        path="/homepage/systemManage/lightUpSchool"
        component={LightUpSchool}
      />

      {/* 门禁进出记录管理 */}
      <PermissionRouter
        path="/homepage/entranceManage/accessRecord"
        component={AccessRecord}
      />
      {/* 在校情况分析 */}
      <PermissionRouter
        path="/homepage/dataAnalysis/schoolAnalysis"
        component={SchoolAnalysis}
      />
      {/* 在校情况分析 */}
      <PermissionRouter
        path="/homepage/dataAnalysis/dormAnalysis"
        component={DormAnalysis}
      />
      {/* 学生卡入库 */}
      <PermissionRouter
        path="/homepage/studentCardRecordIn/studentCardRecordIn"
        component={StudentCardRecordIn}
      />
      {/*/!* 渠道人员录入 *!/*/}
      {/*<PermissionRouter path="/homepage/channelStaffManage/channelStaffManage" component={ChannelStaffManage}/>*/}
      {/*/!* 规则管理 *!/*/}
      <PermissionRouter
        path="/homepage/systemManage/ruleManage"
        component={RuleManage}
      />
      {/*/!* 批量导入 *!/*/}
      <PermissionRouter
        path="/homepage/systemManage/bulkImport"
        component={BulkImport}
      />
      {/* 访客记录管理 */}
      <PermissionRouter
        path={"/homepage/entranceManage/record"}
        component={Record}
      />
      {/*/!*请假管理 *!/*/}
      <PermissionRouter
        path={"/homepage/entranceManage/leaves"}
        component={Leaves}
      />
      {/*/!*学生证管理信息 *!/*/}
      <PermissionRouter
        path={"/homepage/systemManage/studentsOperations"}
        component={Unbinding}
      />
      {/*成绩管理*/}
      <PermissionRouter
        path={"/homepage/interactManage/achievement"}
        component={Achievement}
      />
      {/*成绩发布*/}
      <PermissionRouter
        path={"/homepage/interactManage/achievementIssue"}
        component={AchievementIssue}
      />
      {/*作业发布*/}
      <PermissionRouter
        path={"/homepage/interactManage/releaseInformation"}
        component={ReleaseInformation}
      />
      {/*信息发布*/}
      <PermissionRouter
        path={"/homepage/interactManage/releaseInformationAudit"}
        component={ReleaseInformationAudit}
      />
      {/*智能学生证免打扰*/}
      <PermissionRouter
        path={"/homepage/entranceManage/curriculum"}
        component={Curriculum}
      />
      <PermissionRouter
        path={`/homepage/entranceManage/curriculumStudent/:id`}
        component={CurriculumStudent}
      />
      {/*视频监控*/}
      <PermissionRouter
        path={`/homepage/videoSurveillance/videoSurveillance`}
        component={VideoSurveillance}
      />

      {/* 人员统计 */}
      <PermissionRouter
        path="/homepage/epidemicsituation/personnel"
        component={Personnel}
      />
      {/* 异常人员 */}
      <PermissionRouter
        path="/homepage/epidemicsituation/abnormal"
        component={Abnormal}
      />
      {/* 访客记录 */}
      <PermissionRouter
        path="/homepage/epidemicsituation/visitor"
        component={Visitor}
      />

      {/* 门禁设备管理 */}
      <PermissionRouter
        path="/homepage/terminal/equipment"
        component={Equipment}
      />
      {/* 视屏设备管理 */}
      <PermissionRouter
        path="/homepage/terminal/videoterminal"
        component={VideoTerminal}
      />
      {/* 扫码设备管理 */}
      <PermissionRouter
        path="/homepage/terminal/scanterminal"
        component={ScanTerminal}
      />
      {/* 访客审核记录管理 */}
      <PermissionRouter
        path="/homepage/entranceManage/visitorSreview"
        component={VisitorSreview}
      />

      <PermissionRouter
        path="/homepage/dataAnalysis/videoAttendance"
        component={VideoAttendance}
      />
      {/* 学生证批量换新 */}
      <PermissionRouter
        path="/homepage/systemManage/StudentCardEenew"
        component={StudentCardEenew}
      />
    </Switch>
  );
}
// 把不是通过路由切换过来的组件中，将react-router 的 history、location、match 三个对象传入props对象上
export default withRouter(ContentRoutes);
